import moment from 'moment'
import { nullDisplay } from '../utils'

export default {
  props: ['value', 'options'],
  render(h) {
    if (this.value === null || this.value === this.options.nullValue) {
      return nullDisplay(h, this.options)
    }
    const datetime = moment(this.value * 1000)
    return h('div', [h('div', datetime.format('L')), h('div', datetime.format('HH:mm A'))])
  }
}
